int charge = 0; void SendString(byte InstrNo, int MValue) { Serial.print('#'); Serial.print(InstrNo); Serial.print('M'); Serial.print(MValue); Serial.print('<'); } // the setup routine runs once when you press reset: void setup() { // initialize serial communication at 9600 bits per second: Serial.begin(9600); } // the loop routine runs over and over again forever: void loop() { // read the input on analog pin 0: int sensorValue = analogRead(A0); // print out the value you read: Serial.println(sensorValue); int charge = map(sensorValue,0,500,0,100); // Serial.println(charge); // delay(1000); SendString(1,charge); // Instrument #01 SendString(2,charge); // Instrument #02 SendString(3,charge); // Instrument #03 delay(100); }